<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function show(){
				var _uname=uname.value;
				var xhr=new XMLHttpRequest();
				xhr.onreadystatechange=function(){
					if(xhr.readyState==4 && xhr.status==200){
						var r=xhr.responseText;
						if(r==1){
							alert("用户名已存在")
						}else{
							alert("0")
						}
					}
				}
				xhr.open("get",`/ajax/v1/getUname/${_uname}`,true)
				xhr.send();
			}
		</script>
	</head>
	<body>
		<input type="text" id="uname" placeholder="请输入用户名">
		<button onclick="show()">查询</button>
	</body>
</html>
